import { post, get } from '@/utils/http'

/**
 * 获取用户权限菜单
 * @returns 
 */
export const getUserPermissionMenus = () => get('/api/Permission/GetUserPermissionMenus')

/**
 * 获取权限列表
 * @returns 
 */
export const getPermissions = () => get('/api/Permission/GetPermissions')

/**
 * 获取角色权限列表
 * @param {*} data 
 * @returns 
 */
export const getRolePermissions = data => get('/api/Permission/getRolePermissions', data)

/**
 * 获取租户权限列表
 * @param {Array} data 
 * @returns 
 */
export const getTenantPermissions = data => get('/api/Permission/getTenantPermissions', data)

/**
 * 保存角色权限
 * @param {*} data 
 * @returns 
 */
export const saveRolePermission = (data, callback) => post('/api/permission/saveRolePermission', data, null, callback)

/**
 * 保存租户系统管理员权限
 * @param {*} data 
 * @returns 
 */
export const saveTenantPermission = (data, callback) => post('/api/permission/saveTenantPermission', data, null, callback)

